<!DOCTYPE html>
<html ng-app="account" class="ng-scope">
<head>
    <meta charset="UTF-8">
    <meta name="csrf-token" content="{{ csrf_token() }}">
  <script src="/home/kaidian/js/jquery-1.8.3.min.js" type="text/javascript"></script>
    <title class="ng-binding" ng-bind="pageTitle + ' - 叫外卖上ele.me'">登录 - 叫外卖上tianxia.com</title>

    <link rel="stylesheet" type="text/css" href="{{asset('home/login/css/index.css')}}" media="all">
</head>
<body>
<div class="container" ng-class="{container: !noGlobalWrap}">
    <!-- ngIf: !noGlobalWrap -->
    <header class="account-header ng-scope" ng-if="!noGlobalWrap">
        <a href="http://www.ele.me/"></a>
    </header><!-- end ngIf: !noGlobalWrap -->

    <!-- ngView:  -->
    <div class="account-container ng-scope" ng-view="">
        <div class="login ng-scope"><img class="account-illustration" src="{{asset('home/login/images/banner-app.3e7e4e.png')}}"
            > <!-- ngInclude:  -->
            <div class="account-main aside ng-scope" ng-include="" src="'/app/templates/_login_main.tpl.html'">
                <div class="account-line ng-scope"><h3 class="account-title line-left">登录</h3> <!-- ngIf: normalMode --><a class="login-mode-toggle line-right ng-scope" ng-click="changeMode()" ng-if="normalMode">手机验证登录<span class="icon icon-mobile"></span>
                </a>
                <!-- end ngIf: normalMode -->
                <!-- ngIf: !normalMode --> 
                </div> <!-- ngInclude:  -->
                <div ng-show="normalMode" class="login-form ng-scope" ng-include=""
                     src="'/app/templates/_login_normal.tpl.html'">


                  <form  method="post" action="{{url('/home/user/dologin')}}"name="loginnormal" class="account-form ng-scope ng-pristine ng-invalid ng-invalid-required" ng-submit="loginNormal()" novalidate="">
                    {{csrf_field()}}
                      <div class="form-group error-group ng-hide"
                             ng-show="(loginnormal.$invalid || errTip) &amp;&amp; submitted">
                            <div class="account-errtip ng-binding ng-hide" ng-show="errTip" ng-bind="errTip"></div>
                            <div class="account-errtip" ng-show="loginnormal.username.$error.required">请输入邮箱
                            </div>
                            <div class="account-errtip" ng-show="loginnormal.password.$error.required">请输入密码</div>
                            <div class="account-errtip ng-hide" ng-show="loginnormal.password.$error.minlength">密码长度不对
                            </div>
                            <div class="account-errtip" ng-show="loginnormal.captcha_code.$error.required">请输入验证码</div>
                            <div class="account-errtip ng-hide" ng-show="loginnormal.captcha_code.$error.minlength">
                                验证码位数不对
                            </div>
                            
                        </div>
                        @if(session('info'))
                            <div class="form-group compact" >
                                <font color=red>{{session('info')}}</font>
                            </div>
                        @endif
                        <div id="tip" display="none" height="20px"></div>
                        <div class="form-group compact">
                            <input id="loginemail"name="email" ng-model="normalForm.username"class="account-input withicon ng-pristine ng-invalid ng-invalid-required" placeholder="请输入邮箱" ng-class="{error: submitted &amp;&amp; loginnormal.username.$dirty &amp;&amp; loginnormal.username.$invalid}" update-model-on="loginnormal.submit blur" required="" type="text">
                            <span class="account-inputicon icon icon-user"></span>
                        </div>
                        <div class="form-group">
                            <input name="password" id="password" ng-model="normalForm.password" class="account-input withicon ng-pristine ng-invalid ng-invalid-required" placeholder="密码" ng-class="{error: submitted &amp;&amp; loginnormal.password.$dirty &amp;&amp; loginnormal.password.$invalid}" update-model-on="loginnormal.submit blur" ng-minlength="6" maxlength="20" required="" type="password">
                            <span class="account-inputicon icon icon-lock"></span>
                        </div>
                    <div class="form-group account-verify">
                          <input id="mobileVerify" name="captcha_code" ng-model="normalForm.captcha_code" class="account-input verify ng-pristine ng-invalid ng-invalid-required ng-valid-minlength" placeholder="验证码" update-model-on="loginnormal.submit blur" ng-class="{error: submitted &amp;&amp; loginnormal.captcha_code.$dirty &amp;&amp; loginnormal.captcha_code.$invalid}" ng-minlength="5" maxlength="5" required="">
                        <span captcha="" class="account-captcha">
                            <a onclick="javascript:re_captcha();" >
                                <img src="{{ url('kit/captcha/1') }}"  alt="验证码" title="刷新图片"  id="c2c98f0de5a04167a9e427d883690ff6" border="0">
                            </a>
                        </span>
                </div>
                <div class="form-group compact"><label> <input class="account-checkbox" checked="checked" type="checkbox">下次自动登录 </label></div>
                        <div class="form-group">
                        <button class="account-btn submit ng-binding" ng-class="{disabled: submitting}" type="submit" ng-bind="submitting ? '提交中...' : '登录'">登录
                            </button>
                        </div>
              </form>
            </div> <!-- ngInclude:  -->
             
            <div class="account-line ng-scope">
              <a href="{{ url('/register')}}">新用户注册</a>
              <a class="line-right" href="{{url('/reset')}}">忘记密码</a>
            </div>

           
            </div>
        </div>
    </div>

    <!-- ngIf: !noGlobalWrap -->
    <footer class="account-footer ng-scope" ng-if="!noGlobalWrap">
        <p class="footer-line">
            <a class="footer-link" href="http://kaidian.ele.me/">我要开店</a> |
            <a class="footer-link" href="http://ele.me/support/about/contact">联系我们</a> |
            <a class="footer-link" href="http://ele.me/support/about/agreement">服务条款和协议</a> |
            <a class="footer-link" href="http://jobs.ele.me/">加入我们</a>
        </p>
        <p class="footer-line line-under">
            增值电信业务许可证 : <a class="footer-link" target="_blank" rel="nofollow" href="http://www.shca.gov.cn/">沪B2-20150033</a>
            |
            <a class="footer-link" target="_blank" rel="nofollow" href="http://www.miibeian.gov.cn/">沪ICP备 09007032</a>
            |
            <a class="footer-link" target="_blank" rel="nofollow"
               href="http://www.sgs.gov.cn/lz/licenseLink.do?method=licenceView&amp;entyId=20120305173227823">上海工商行政管理</a>
            Copyright ©2008-2015 ele.me, All Rights Reserved.
        </p>
    </footer><!-- end ngIf: !noGlobalWrap -->
</div>

<script>  
    function re_captcha() 
    {
      $url = "{{ url('kit/captcha') }}";
      $url = $url + "/" + Math.random();
      document.getElementById('c2c98f0de5a04167a9e427d883690ff6').src=$url;
    }
</script>
<script type="text/javascript">                
<!-- 验证邮箱 -->
      window.onload = function(){  
            
            $("#loginemail").blur(function(){
                  if($("#loginemail").val()=="")
                  {
                     $("#tip").css('display', 'block').html("<font color=red>邮箱不能为空</font>");

                     return false;
                  }

                  var email=$("#loginemail").val();
                  if(!email.match(/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/))
                  {
                    $("#tip").css('display', 'block').html("<font color=red>格式不正确！请重新输入</font>");
                    
                    return false;
                  }
            });
            $("#loginemail").focus(function()
                {
                  $("#tip").css('display', 'none');
                });

            //验证 验证码
            $("#mobileVerify").blur(function(){
                  if($("#mobileVerify").val()=="")
                  {
                     $("#tip").css('display', 'block').html("<font color=red>验证码不能为空</font>");
                      return false;
                  }

            });
            $("#mobileVerify").focus(function()
              {
                $("#tip").css('display', 'none');
              });

             //验证密码
           $("#password").blur(function(){
                  if($("#password").val()=="")
                  {
                     $("#tip").css('display', 'block').html("<font color=red>密码不能为空</font>");
                     return false;
                  }

                  if($("#password").val().length < 6 )
                  {
                      $("#tip").css('display', 'block').html("<font color=red>密码长度6-20字符</font>");
                      return false;
                  }
            });
           $("#password").focus(function()
            {
              $("#tip").css('display', 'none');
            });
              

     }
</script>
</body>
</html>
